package com.cxyd.modules.log.controller;

import com.cxyd.common.page.PageData;
import com.cxyd.common.utils.Result;
import com.cxyd.modules.log.dto.SysLogWorkDTO;
import com.cxyd.modules.log.service.SysLogWorkService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * 作业日志
 *
 * @author Cycle gengruyi01@163.com
 * @since 1.0.0 2022-11-14
 */
@RestController
@RequestMapping("sys/log-work")
public class SysLogWorkController {
    private final SysLogWorkService sysLogWorkService;

    public SysLogWorkController(SysLogWorkService sysLogWorkService) {
        this.sysLogWorkService = sysLogWorkService;
    }

    @GetMapping("page")
    @RequiresPermissions("sys:log-work")
    public Result<PageData<SysLogWorkDTO>> page(@RequestParam Map<String, Object> params) {
        PageData<SysLogWorkDTO> page = sysLogWorkService.page(params);

        return new Result<PageData<SysLogWorkDTO>>().ok(page);
    }
}